<header class="main-header">
    <a href="{:U('index/index')}" class="logo">
        <span class="logo-mini"><i class="fa fa-home"></i></span>
        <span class="logo-lg"><b>{:C('WEB_SITE_NAME')}</b></span>
    </a>
    <nav class="navbar navbar-static-top">
        <a href="#" class="sidebar-toggle" data-toggle="offcanvas" role="button">
            <i></i>
            <i></i>
            <i></i>
            <span class="sr-only">Toggle navigation</span>
        </a>
        <a href="javascript:void(0)" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-collapse">
            <i></i>
            <i></i>
            <i></i>
            <!-- <i class="fa fa-bars"></i> -->
        </a>
        <div class="collapse navbar-collapse pull-left" id="navbar-collapse">
            <ul id="jtopnav" class="nav navbar-nav">
                <volist name="__MENU__.main" id="menu">
                    <li class="{:$menu['class']=='current'?'active':''}"><a class="pjax" href="{:U($menu['url'])}">{$menu.title} </a></li>
                </volist>
            </ul>
        </div>
        <div class="navbar-custom-menu">
            <ul class="nav navbar-nav">
                <?php if(is_administrator()):?>
                <li>
                    <?php $errorCount = getErrorCount();?>
                    <a  href="{:U('index/logview')}" title="统计今天发生的错误/警告数量, 开发者可见">
                        <span style="background:#dd4b39 !important;padding:5px 10px;border-radius:5px;margin-right:10px;">
                            <i class="fa fa-close"></i> {$errorCount['error']}</i>
                        </span>
                        <span style="background:#f39c12 !important;padding:5px 10px;border-radius:5px;">
                            <i class="fa fa-warning"></i> {$errorCount['warning']}</i>
                        </span>
                    </a>
                </li>
                <?php endif;?>
                <li>
                    <a target="_blank" href="/"><i class="fa fa-home"></i></a>
                </li>
                <?php if(session('user_auth.username') == '开发者账户'): ?>

                <li>
                    <a target="_blank" href="/api"><i class="fa fa-adn"></i></a>
                </li>

                <?php endif;?>
                <?php if(checkRule('index/cache')):?>
                <li>
                    <a id="j_c_cache" href="{:U('index/cache')}"><i class="fa fa-refresh"></i></a>
                    <script>
                        $('#j_c_cache').click(function() {
                            var el = $(this);
                            var icon = el.find('i');
                            icon.addClass("rotate360");
                            $.get(el.attr('href'), {}, function(info) {
                                popup.tip(info.info);
                                icon.removeClass("rotate360");
                            }, 'json');
                            return false;
                        });
                    </script>
                </li>
                <?php endif;?>
                <li class="dropdown user user-menu">
                    <a href="#" class="no-link dropdown-toggle" data-toggle="dropdown" aria-expanded="true">
                        <img src="/Kcdns/Public/Admin/img/avatar6.jpg" class="user-image" alt="User Image">
                        <span class="hidden-xs">{:session('user_auth.username')}</span>
                    </a>
                    <ul class="dropdown-menu" style="margin-top:1px;border-radius:0px;box-shadow:5px 5px 10px #bbb;border:none;">
                        <li class="user-header">
                            <img src="/Kcdns/Public/Admin/img/avatar6.jpg" class="img-circle" alt="User Image">
                            <p>
                                {:session('user_auth.username')}
                            </p>
                        </li>
                        <!-- Menu Body -->
                        <!-- Menu Footer-->
                        <li class="user-footer">
                            <div class="pull-left">
                                <a href="{:U('Member/password')}" class="btn btn-default btn-flat">修改密码</a>
                            </div>
                            <div class="pull-right">
                                <a href="{:U('Public/logout')}" class="btn btn-default btn-flat">退出系统</a>
                            </div>
                        </li>
                    </ul>
                </li>
                <li class="hidden-xs">
                    <a href="#" data-toggle="control-sidebar"><i class="fa fa-gears"></i></a>
                </li>
            </ul>
        </div>
    </nav>
</header>
